#ifndef _VN_SFML_TEXTURE_MANAGER_H_
#define _VN_SFML_TEXTURE_MANAGER_H_

#include <map>
#include <string>
#include "SFML\Graphics.hpp"
#include "..\ResourceMode.h"
#include "..\Generic\sfmlphysfs.hpp"

namespace vn
{
	class SFMLTextureManager
	{
	public:
		typedef const sf::Texture& (vn::SFMLTextureManager::*LoadTexFptr)(const std::string&, const std::string&, bool, bool);

		SFMLTextureManager(void);
		virtual ~SFMLTextureManager(void);

		const sf::Texture& loadTexture(const std::string& p_id, const std::string& p_filepath, bool p_repeat = false, bool p_smooth = false);

		void unloadTexture(const std::string&);
		void unloadTexture(const sf::Texture&);
		void unloadAllTextures();

		void resourceMode(int p_mode);

	private:
		inline const sf::Texture& loadFromStream(const std::string& p_id, const std::string& p_filepath, bool p_repeat = false, bool p_smooth = false);
		inline const sf::Texture& loadFromFile(const std::string& p_id, const std::string& p_filepath, bool p_repeat = false, bool p_smooth = false);

		LoadTexFptr m_loadTexFptr[RESOURCE_MODE_SIZE];
		int m_mode;

		std::map<std::string, sf::Texture> m_textures;
	};
}

#endif // _VN_SFML_TEXTURE_MANAGER_H_